import http.client


conn=http.client.HTTPConnection('localhost')
conn.request('GET',"/agileone/")
setcookie=conn.getresponse().getheader("Set-Cookie")
sessionid=setcookie.split(";")[0]
print(sessionid)

param="username=admin&password=admin&savelogin=true"
header={"Content-type":"application/x-www-form-urlencoded","Cookie":sessionid}
conn=http.client.HTTPConnection('localhost')
conn.request("POST","/agileone/index.php/common/login",param,header)

param="type=Requirement&importance=medium&scope=1&headline="\
        "Headline from Python-12346&content"\
        "Content from Python-12346&processresult="

header={"Content-type":"application/x-www-form-urlencoded","Cookie":sessionid}
conn=http.client.HTTPConnection('localhost')
conn.request("POST","/agileone/index.php/proposal/add",param.encode(),header)

response=conn.getresponse().read()
print(response.decode())